package leetcode2;

public class Day20 {

    public static void main(String[] args) {
        int num  = Integer.parseInt("001");
        //System.out.println(num);
        divisorSubstrings(30003,3);
    }






    public  static int divisorSubstrings(int num, int k) {
        String str = String.valueOf(num);
        int left=0,right=k,ret=0;
        while (right<=str.length()) {
            //枚举所有的情况
            String s = str.substring(left++,right++);
            int tmp = Integer.parseInt(s);
            if(tmp!=0 && num % tmp == 0) ret++;
        }
        return ret;
    }
}
